﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.SqlClient;
using moviecentro;

namespace CruzSur.Controllers
{
     public static partial class AppDa
    {
        static gestor dbgestor = new gestor("LocalSqlServer");
        static MySQLBuilder dbsql = new MySQLBuilder("LocalSqlServer");

        public static List<SelectListItem> ListarAgencia()
        {
            // ----- Lista tipo
            List<SelectListItem> ListData = new List<SelectListItem>();

            SqlDataReader readerTipoObservacion = dbgestor.ListarSql("Select * from Agencia where Estado = 1");
            


            while (readerTipoObservacion.Read())
            {
                SelectListItem ListItem = new SelectListItem();
                ListItem.Text = readerTipoObservacion["Nombre"].ToString();
                ListItem.Value = readerTipoObservacion["Id"].ToString();
                ListData.Add(ListItem);
            }
            readerTipoObservacion.Close();

            return ListData;
        }
    }
}